<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/common/common-taglib.jsp"%>

<div class="am-cf am-padding">
	<div class="am-fl am-cf">
		<strong class="am-text-primary am-text-lg">教学任务管理</strong> / <small>任务查询</small>
	</div>
</div>

<div class="am-g">
	<div class="am-u-md-9 am-cf">
		<div class="am-fl am-cf">
			<div class="am-btn-toolbar am-fl">
				<div class="am-btn-group am-btn-group-xs">
					<t:pril action="/task/addTask">
						<button type="button"
							onclick="javascript:$.AMUI.progress.start();location.href='task/addTask.action';"
							class="am-btn am-btn-default">
							<span class="am-icon-plus"></span> 添加任务
						</button>
					</t:pril>
				</div>
				<div class="am-form-group am-margin-left am-fl">
					年份：<select id="taskYear" class="dll-query" name="taskYear">
						<option value="">全部</option>
						<c:forEach items="${yearList}" var="year">
							<option value="${year}"
								<c:if test="${task.taskYear==year}">selected</c:if>>${year}</option>
						</c:forEach>
					</select>
				</div>
				<div class="am-form-group am-margin-left am-fl">
					学期：<select id="taskTerm" class="dll-query" name="taskTerm">
						<option value="">全部</option>
						<option value="1"
							<c:if test="${task.taskTerm=='1'}">selected</c:if>>第一学期</option>
						<option value="2"
							<c:if test="${task.taskTerm=='2'}">selected</c:if>>第二学期</option>
					</select>
				</div>
				<div class="am-form-group am-margin-left am-fl">
					班级：<select id="classId" class="dll-query" name="classId">
						<option value="">全部</option>
						<c:forEach items="${clazzList}" var="clazz">
							<option value="${clazz.classId}"
								<c:if test="${task.classId==clazz.classId}">selected</c:if>>${clazz.className}</option>
						</c:forEach>
					</select>
				</div>
				<div class="am-form-group am-margin-left am-fl">
					课程：<select id="courseId" class="dll-query" name="courseId">
						<option value="">全部</option>
						<c:forEach items="${courseList}" var="course">
							<option value="${course.courseId}"
								<c:if test="${task.courseId==course.courseId}">selected</c:if>>${course.courseName}</option>
						</c:forEach>
					</select>
				</div>
			</div>
		</div>
	</div>
	<!-- 	<div class="am-u-md-3 am-cf"> -->
	<!-- 		<div class="am-fr"> -->
	<!-- 			<div class="am-input-group am-input-group-sm"> -->
	<!-- 				<input type="text" id="queryStr" class="am-form-field" -->
	<%-- 					placeholder="课程名" value="${queryStr}" --%>
	<!-- 					onkeypress="if(event.keyCode==13){queryBtn.click();return false;}"> -->
	<!-- 				<span class="am-input-group-btn"> -->
	<!-- 					<button class="am-btn am-btn-default dll-query" type="button" -->
	<!-- 						id="queryBtn">搜索</button> -->
	<!-- 				</span> -->
	<!-- 			</div> -->
	<!-- 		</div> -->
	<!-- 	</div> -->
</div>

<div class="am-g">
	<div class="am-u-sm-12">
		<form class="am-form">
			<table class="am-table am-table-striped am-table-hover table-main">
				<thead>
					<tr>
						<th class="table-title">ID</th>
						<th class="table-title">年份</th>
						<th class="table-title">学期</th>
						<th class="table-title">班级</th>
						<th class="table-title">课程名</th>
						<th class="table-title">备注</th>
						<th class="table-detail">操作</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${page.beanList}" var="task">
						<tr>
							<td>${task.taskId}</td>
							<td>${task.taskYear}</td>
							<td><t:dictdata dictdata="${task.taskTerm}" dict="term" /></td>
							<td>${task.className}</td>
							<td>${task.courseName}</td>
							<td><t:sub length="10" value="${task.remark}" /></td>
							<td>
								<div class="am-btn-toolbar">
									<div class="am-btn-group am-btn-group-xs">
										<t:pril action="/task/updateTask">
											<button
												class="am-btn am-btn-default am-btn-xs am-text-secondary"
												onclick="javascript:$.AMUI.progress.start();location.href='task/updateTask.action?taskId=${task.taskId}'"
												type="button">
												<span class="am-icon-pencil-square-o"></span> 编辑
											</button>
										</t:pril>
										<t:pril action="/task/deleteTask">
											<button
												class="am-btn am-btn-default am-btn-xs am-text-danger"
												onclick="deleteTask(${task.taskId})" type="button">
												<span class="am-icon-trash-o"></span> 删除
											</button>
										</t:pril>
										<t:pril action="/task/detailTask">
											<button class="am-btn am-btn-default am-btn-xs"
												onclick="javascript:$.AMUI.progress.start();location.href='task/detailTask.action?taskId=${task.taskId}'"
												type="button">
												<span class="am-icon-trash-o"></span> 详情
											</button>
										</t:pril>
									</div>
								</div>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<!-- 页码 -->
			<%@ include file="/WEB-INF/views/common/page-index.jsp"%>
		</form>
	</div>
	<!-- 操作结果 -->
	<%@ include file="/WEB-INF/views/common/operate-message.jsp"%>
	<!-- 控制 js -->
	<script src="assets/script/task/task-query.js"></script>
</div>